package com.example.springboot.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author jiang
 * @since 2025-04-17
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("user")
@Schema(name = "UserEntity", description = "用户表")
public class UserEntity extends Model<UserEntity> {

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "账号")
    @TableField("account")
    private String account;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @Schema(description = "头像")
    @TableField("avatar")
    private String avatar;

    @Schema(description = "姓名")
    @TableField("name")
    private String name;

    @Schema(description = "性别")
    @TableField("sex")
    private String sex;

    @Schema(description = "生日")
    @TableField("birth")
    private String birth;

    @Schema(description = "电话")
    @TableField("phone")
    private String phone;

    @Schema(description = "地址")
    @TableField("address")
    private String address;

    @Schema(description = "角色")
    @TableField("role")
    private Integer role;

    @Schema(description = "创建时间")
    @TableField("current")
    private Date current;

    public static final String ID = "id";

    public static final String ACCOUNT = "account";

    public static final String PASSWORD = "password";

    public static final String AVATAR = "avatar";

    public static final String NAME = "name";

    public static final String SEX = "sex";

    public static final String BIRTH = "birth";

    public static final String PHONE = "phone";

    public static final String ADDRESS = "address";

    public static final String ROLE = "role";

    public static final String CURRENT = "current";

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
